<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

header("Cache-Control", "no-cache, no-store, must-revalidate");
header("Pragma", "no-cache");
?>

{
    "buildings":[
        <?php foreach($models as $model) { ?>
        {
            "id":<?php echo $model->id; ?>,
            "label":"<?php echo $model->name; ?>",
            "floors":[
                <?php foreach($model->floors as $floor) { ?>
                {
                    "id":<?php echo $floor->id; ?>,
                    "label":"<?php echo $floor->floor_number; ?>"
                },
                <?php } ?>
            ]
        },
        <?php } ?>
    ]
}
